package com.cqhfan.chatroom.controller;


import com.cqhfan.chatroom.domain.po.ChatList;
import com.cqhfan.chatroom.domain.vo.ChatListVO;
import com.cqhfan.chatroom.service.IChatListService;
import com.cqhfan.common.domain.dto.PageDTO;
import com.cqhfan.common.domain.query.PageQuery;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 用户聊天列表项 前端控制器
 * </p>
 *
 * @author 眭传洪
 * @since 2024-11-22
 */
@Tag(name = "聊天列表相关接口")
@RestController
@RequestMapping("/chat-list")
@RequiredArgsConstructor
public class ChatListController {

    private final IChatListService chatListService;

    @Operation(summary = "创建聊天列表项")
    @PostMapping("/createChatListItem")
    public void createChatListItem(@RequestBody ChatList body) {
        chatListService.createChatListItem(body);
    }

    @Operation(summary = "获取我的聊天列表")
    @GetMapping("/listMyChatList")
    public List<ChatListVO> listMyChatList() {
        return chatListService.listMyChatList();
    }

}
